package com.example.onlinereadingsystem.demos.web.dto.common;

import lombok.Data;

/**
 * @Description 全局记录参数
 * @Author ljm
 * @Date 2024/12/20
 */
@Data
public class BaseContext {
    private static ThreadLocal<String> id = new ThreadLocal<>();
    private static ThreadLocal<String> userName = new ThreadLocal<>();

    public static void setId(String s) {
        id.set(s);
    }

    public static String getId() {
        return id.get();
    }

    public static void setUserName(String s) {
        userName.set(s);
    }

    public static String getUsername() {
        return userName.get();
    }

}
